﻿@{
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

@model bool
<div class="padding5">
    <div class="panel-header" style="width: 1021px;">
        <div class="panel-title">大屏挂起告警显示</div>
        <div class="panel-tool"></div>
    </div>
    <div class="panel-body">
        <div class="padding20">
            <div>挂起的监控告警是否显示:</div>
            <div style="padding: 20px 0;">
                <input type="radio" name="isPending" value="1" id="pending_1" @(Model ? "checked='checked'" : "") />
                <label for="pending_1">是</label>
                <input type="radio" name="isPending" value="0" id="pending_0" @(Model ? "" : "checked='checked'") />
                <label for="pending_0">否</label>
            </div>
            <input type="button" value="设置" onclick="submitChange();" />

        </div>
    </div>
</div>

<script type="text/javascript">
    var submitChange = function () {
        var isPending = $('[name="isPending"]:checked').val();
        $.messager.confirm('提醒', '确认设置吗？', function (r) {
            if (r) {
                $.post('/AdminPermission/UpdateIncludePendingAlert', { result: isPending }, function (res) {
                    if (res == "OK") {
                        $.messager.alert('提示', '设置成功!', 'info');
                    }
                    if (res == "Error") {
                        $.messager.alert('错误', '设置失败!', 'error');
                    }
                });
            }
        });
    };
</script>

